﻿@model VietPremier.Areas.AdminCP.Models.AdminBrouchureModel

@{
    ViewBag.Title = "Edit";
    Layout = "~/Areas/AdminCP/Views/Shared/AdminLayout.cshtml";
}

<script type="text/javascript" src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-1.7.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Content/cssAdmin/js/plugins/jquery-ui-1.8.16.custom.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>
<script type="text/javascript">
    
    jQuery(document).ready(function () {

        $('#nofSuccess').hide(); // an thong bao
        $('#nofError').hide();

    });
  

    function alertMsg(msg) {
        $('#nofSuccess').hide();
        $('#nofError').show();
        $('#msgNofError').text(msg);
    }

    function checkField() {
        var file = $("#FilePDF").val();
        if (file == null || file == "") {

        }
        else {

        }

        return confirm("Do you want to continue to Edit this Brouchure?");
    }

</script>
<div class="maincontentinner">

    <ul class="maintabmenu">
        <li><a href="@Url.Action("Index", "AdminBrouchure")" >Quản lý danh sách brochure</a></li>
        <li><a href="@Url.Action("Insert", "AdminBrouchure")" >Thêm mới brochure</a></li>
    </ul>
    <!--maintabmenu-->

    <div class="notification msgsuccess" style="display: none" id="nofSuccess">
        <a class="close"></a>
        <p id="msgNofSuccess">This is a success message.</p>
    </div>
    <!-- notification msgsuccess -->

    <div class="notification msgerror" style="display: none" id="nofError">
        <a class="close"></a>
        <p id="msgNofError">This is an error message.</p>
    </div>
    <!-- notification msgerror -->

    @using (Html.BeginForm("Edit", "AdminBrouchure", FormMethod.Post, new { @id = "formCreate", @class = "stdform stdform2", enctype = "multipart/form-data" }))
    {
       @Html.ValidationSummary()
        @Html.HiddenFor(model => model.Id)
       
       
             
             <div class="contenttitle radiusbottom0">
            <h2 class="table"><span>Thông tin brochure</span></h2>
        </div>
        <p>
            <label>Tên</label>
            <span class="field">
                @Html.TextBoxFor(model => model.Name)
            </span>
        </p>
      <p>
            <label>Tập tin</label>
             @{
                var file = "~/Content/upload/brouchure/";
                if (Model.LinkDownload != null)
                {
                    file += Model.LinkDownload;
                }
                else
                {
                    file = "not have file";
                }
            }
            <span class="field">
                @file</span>
        </p>
        <p>
            <label>Thay đổi tập tin</label>
            <span class="field">
                <input type="file" name="FilePDF" id="FilePDF" />
            </span>
        </p>
        
         
                
        <p class="stdformbutton">
            <input type="submit" value="Submit" onclick="return checkField()" />
            <input type="submit" value="Back" onclick="javascript: history.back(); return false" />
        </p>

    }

    <br clear="all" />

</div>


